import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatMaterialController } from '../../../controllers';
const uctoowechatMaterialRouter = new Router();
const wechatMaterialController = new uctooWechatMaterialController();

uctoowechatMaterialRouter.post('/add', requireUser, wechatMaterialController.add);
uctoowechatMaterialRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechat_material'), wechatMaterialController.edit);
uctoowechatMaterialRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechat_material'), wechatMaterialController.delete);

//For getting wechatMaterial with permission control
uctoowechatMaterialRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechat_material'), wechatMaterialController.getSingle);
uctoowechatMaterialRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechat_material'), wechatMaterialController.getMany);
uctoowechatMaterialRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechat_material'), wechatMaterialController.getMany);

//#endregion AutoCreateCode
export default uctoowechatMaterialRouter;
